<template>
  <div id="app">
    <router-view/>

    <transition name="fade">
      <com-loading v-if="loading" />
    </transition>

  </div>
</template>

<script>
  import { mapGetters } from 'vuex'

  import comLoading from '@/components/comLoading/comLoading'

  export default {
    components:{
      comLoading,
    },
    created() {
      this.getTagList()
      if(this.token)this.$store.dispatch('user/getMenuInfo')
    },
    computed: {
      ...mapGetters({
        permission:'user/getPermission',
        token:'user/getToken',
        loading:'loading/getLoading',
      }),
    },
    methods: {
      getTagList() {
        this.$store.dispatch('article/getTags')
      },
    },
  }
</script>

<style lang="less">
  #app{
    width: 100%;
    height: 100%;
  }

  .fade-enter,
  .fade-leave-active {
    opacity: 0;
  }
  .fade-enter-active,
  .fade-leave-active {
    transition: opacity 0.5s;
  }

  @import "assets/css/base";
</style>
